package scheduler

import "go-reptile/crawler/engine"

/*实现了Scheduler*/
type SimpleScheduler struct {
		workerChan chan engine.Request
}

func (s *SimpleScheduler) WorkerChan() chan engine.Request {
	return s.workerChan
}

func (s *SimpleScheduler) WorkerReady(chan engine.Request) {
}

func (s *SimpleScheduler) Run() {
	s.workerChan = make(chan engine.Request)
}

func (s *SimpleScheduler) Submit(r engine.Request){
		// 开一个goroutine执行，不然会循环等待 卡死哦
		go func() {
			s.workerChan <- r
		}()

}
